
#---Portmann & Stojanovic 2017: Electoral discrimination against immigrant-origin candidates---#

#load("PrefVotes")

#-------------------- ESTIMATE MODEL (HIERARCICAL BETA REGRESSION, LOGIT LINK, INTERACTION EFFECTS)

model4 <- glmmadmb(crossoff_pct ~ nonswissnames + incumbent + c_relposition_rc + precumulated + 
                     sex_d + age_c3 + CodeBerufK3 + num_cand + party_c3 + nonswissnames:party_c3 +
                     nonswissnames:sex_d + nonswissnames:incumbent + nonswissnames:c_relposition_rc + nonswissnames:CodeBerufK3 + 
                     commune + (~1|list_id), data=d, family="Beta", admb.opts=admbControl(shess=FALSE,noinit=FALSE))

#-------------------- REGRESSION TABLE

htmlreg(model4, custom.model.names = "Model 1",
        # reorder.coef = c(1, 2, 3),
        caption = "Model with additional interaction effects",
        label = "tab:5",
        stars = c(0.05, 0.01, 0.001),
        dcolumn = TRUE,
        booktabs = TRUE,
        use.packages = FALSE,
        single.row = TRUE,
        include.adjrs = FALSE,
        include.bic = FALSE, file = "Table6.doc")
